﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;

namespace FeeWcfService.DataContracts
{
    [DataContract]
    public class Portfolio : IEquatable<Portfolio>
    {
        [DataMember]
        public Guid PortfolioGuid { get; set; }
        [DataMember]
        public String Name { get; set; }
        [DataMember]
        public Int32 Pfo { get; set; }
        [DataMember]
        public Int32 ValCalendar { get; set; }
        [DataMember]
        public Int32 ExchangeRateSet { get; set; }
        [DataMember]
        public Boolean IsPfo { get; set; }
        [DataMember]
        public String Currency { get; set; }

        [DataMember]
        public List<string> Currencies
        {
            get
            {
                return new List<string> { Currency, "CHF", "" };
            }
        }

        public virtual bool Equals(Portfolio other)
        {
            if (other == null) return false;

            return PortfolioGuid == other.PortfolioGuid &&
                   Name == other.Name &&
                   Pfo == other.Pfo &&
                   ValCalendar == other.ValCalendar &&
                   ExchangeRateSet == other.ExchangeRateSet &&
                   IsPfo == other.IsPfo &&
                   Currency == other.Currency;
        }
    }
}